import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/components/Login'
import Index from '@/components/Index'
import InfoManager from '@/components/InfoManager'
import CourseTypeManager from '@/components/CourseTypeManager'
import PublishCourse from '@/components/PublishCourse'
import CourseManager from '@/components/CourseManager'
import CoursePlayer from '@/components/CoursePlayer'
import CourseLooker from '@/components/CourseLooker'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      component: Login
    },
    {
      path: '/CoursePlayer/:cid/:cname',
      component: CoursePlayer
    },
    {
      path: '/CourseLooker/:cid/:token',
      component: CourseLooker
    },
    {
      path: '/Index',
      component: Index,
      children: [
        {
          path: '/InfoManager',
          component: InfoManager
        },
        {
          path: '/CourseTypeManager',
          component: CourseTypeManager
        },
        {
          path: '/PublishCourse',
          component: PublishCourse
        },
        {
          path: '/CourseManager',
          component: CourseManager
        }
      ]
    }
  ]
})
